<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>使用css3制作文字跑马灯</title>
    <style>
        .marquee-outer-wrapper{
            overflow: hidden;
            width: 50%;
            margin: auto;
        }
        .marquee-inner-wrapper{
            background: #eee;
            height: 40px;
            font-size: 14px;
            color: red;
            line-height: 40px;
            margin: 0 auto;
            white-space: nowrap;
            position: relative;
        }
        .marquee-inner-wrapper .text{
            position: absolute;
            top: 0;
            left: 100%;
            overflow: hidden;
            word-break: break-all;
            word-wrap: break-word;
            padding: 0 20px;
            width: 100%;
        }

        .marquee{
            -webkit-animation: 15s rolling linear infinite normal;
            animation: 15s rolling linear infinite normal;
        }
        .marquee-delay {
            -webkit-animation-delay: 7s;
            animation-delay: 7s;
        }
        @keyframes rolling {
            0% {
                -webkit-transform: translate(0%, 0);
                transform: translate(0%, 0);
            }
            100% {
                -webkit-transform: translate(-200%, 0);
                transform: translate(-200%, 0);
                display: none;
            }
        }
    </style>
</head>
<body>
<div class="marquee-outer-wrapper">
    <div class="marquee-inner-wrapper">
        <div class="marquee text">使用css3制作文字跑马灯</div>
        <div class="marquee marquee-delay text">使用css3制作文字跑马灯</div>
    </div>
</div>
</body>
</html>